import request from '@/utils/request'

const api = {
  page: '/pm-center/project-application/page',
  delete: '/pm-center/project-application/delete',
  getById: '/api/pm-center/project-application/findById',
  modify: '/pm-center/project-application/modify',
  add: '/pm-center/project-application/add',
  detail: '/pm-center/project-application/findById',
  // getById: '/api/pm-center-center/project-application/findById',
  // modify: '/api/pm-center-center/project-application/modify',
  upload: '/pm-center/file/upload',
  download: '/pm-center',
  update: '/pm-center/project-application/modify',
  getMember: '/pm-center/projectMember/getByProjectApplicationId',
  addMember: '/pm-center/projectMember/add',
  updateMember: '/pm-center/projectMember/modify',
  deleteMember: '/pm-center/projectMember/delete',
  getCategoryTable: '/pm-center/fnaAllot/getByAppAndCategory',
  getSmallCategory: '/pm-center/fna/configuration/smallCategoryList',
  getBigCategory: '/pm-center/fna/configuration/categoryList',
  getDeviceTable: '/pm-center/fna/deviceSoftware/getByProjectApplicationId',
  deleteDevice: '/pm-center/fna/deviceSoftware/delete',
  addDevice: '/pm-center/fna/deviceSoftware/add',
  softDeviceTable: '/pm-center/fna/technologyTransfer/getByProjectApplicationId',
  deleteSoftDevice: '/pm-center/fna/technologyTransfer/delete',
  addSoftDevice: '/pm-center/fna/technologyTransfer/add',
  metralList: '/pm-center/fna/materialFuel/getByProjectApplicationId',
  addmetral: '/pm-center/fna/materialFuel/add',
  deleteMetral: '/pm-center/fna/materialFuel/delete',
  fuelList: '/pm-center/fna/fuelPower/getByProjectApplicationId',
  deleteFuel: '/pm-center/fna/fuelPower/delete',
  addFuel: '/pm-center/fna/fuelPower/add',
  assayList: '/pm-center/fna/testAssayProcessing/getByProjectApplicationId',
  deleteAssay: '/pm-center/fna/testAssayProcessing/delete',
  addAssay: '/pm-center/fna/testAssayProcessing/add',
  trialList: '/pm-center/fna/trial/getByProjectApplicationId',
  addTrial: '/pm-center/fna/trial/add',
  deleteTrial: '/pm-center/fna/trial/delete',
  outList: '/pm-center/fna/outsourcedResearch/getByProjectApplicationId',
  deleteOut: '/pm-center/fna/outsourcedResearch/delete',
  addOut: '/pm-center/fna/outsourcedResearch/add',
  pubList: '/pm-center/fna/pubDocAffairs/getByProjectApplicationId',
  addPub: '/pm-center/fna/pubDocAffairs/add',
  deletePub: '/pm-center/fna/pubDocAffairs/delete',
  exList: '/pm-center/fna/accountBudgets/getByProjectApplicationId',
  addEx: '/pm-center/fna/accountBudgets/add',
  deleteEx: '/pm-center/fna/accountBudgets/delete',
  conList: '/pm-center/fna/exchange/getByProjectApplicationId',
  addCon: '/pm-center/fna/exchange/add',
  deleteCon: '/pm-center/fna/exchange/delete',
  luList: '/pm-center/fna/consultation/getByProjectApplicationId',
  addLu: '/pm-center/fna/consultation/add',
  deleteLu: '/pm-center/fna/consultation/delete',
  otherList: '/pm-center/fna/other/getByProjectApplicationId',
  addOther: '/pm-center/fna/other/add',
  deleteOther: '/pm-center/fna/other/delete',
  updateDemon: '/pm-center/demonstration/modify',
  getPrice: '/pm-center/fna/summary/categoryAmount',
  getCategory: '/pm-center/fnaAllot/getByAppAndCategory',
  getAllPrice: '/pm-center/fnaAllot/getTotalByProjectApplicationId',
  saveBuget: '/pm-center/fnaAllot/save',
  getDemon: '/pm-center/demonstration/getByProjectApplicationId',
  getFileInfo: '/pm-center/file/findByIds',
  getBudgetInfoByMainId: '/pm-center/fnaAllot/getBudgetInfo',
  getSummaryAmount: '/pm-center/fna/summary/amount',
  getSummaryYearAmount: '/pm-center/fna/summary/yearAmount',
  indirctList: '/pm-center/fna/indirect/getByProjectApplicationId',
  addIndirct: '/pm-center/fna/indirect/add',
  deleteIndirct: '/pm-center/fna/indirect/delete',
  updateIndirct: '/pm-center/fna/indirect/modify',
  totalSmallAmount:'/pm-center/fnaAllot/getAllSmallCategoryAmountByMainId',
  getDocData: '/pm-center/fna/docData/getByProjectApplicationId',
  saveDocData: '/pm-center/fna/docData/save',
  downloadDocData: '/pm-center/fna/docData/download',
  downloadAllDocData: '/pm-center/fna/docData/downloadAll',
}
const dept = {
  dept: '/sys-center/api/system/dept/tree'

}

const trial = {
  add: '/pm-center/fna/trialHead/add',
  delete:'/pm-center/fna/trialHead/delete',
  findAll:'/pm-center/fna/trialHead/findAll',
  findById:'/pm-center/fna/trialHead/findById',
  modify:'/pm-center/fna/trialHead/modify'

}

export default dept


export function addHeadTrial(data){
  return request({
    url: trial.add,
    method: 'post',
    params: data
  })
}
export function deleteHeadTrial(data){
  return request({
    url: trial.delete,
    method: 'delete',
    params: data
  })
}
export function findAllHeadTrial(parameter) {
  return request({
    url: trial.findAll,
    method: 'get',
    params: parameter
  })
}
export function findByIdHeadTrial(parameter) {
  return request({
    url: trial.findById,
    method: 'get',
    params: parameter
  })
}
export function modifyHeadTrial(parameter) {
  return request({
    url: trial.modify,
    method: 'post',
    data: parameter
  })
}
export function totalSmallAmount(parameter) {
  return request({
    url: api.totalSmallAmount,
    method: 'get',
    params: parameter
  })
}
export function deleteIndirct(data) {
  return request({
    url: api.deleteIndirct,
    method: 'delete',
    params: data
  })
}

export function updateIndirct(data) {
  return request({
    url: api.updateIndirct,
    method: 'post',
    data: data
  })
}


export function addIndirct(data) {
  return request({
    url: api.addIndirct,
    method: 'post',
    data: data
  })
}

export function indirctList(parameter) {
  return request({
    url: api.indirctList,
    method: 'get',
    params: parameter
  })
}

export function getDocData(parameter) {
  return request({
    url: api.getDocData,
    method: 'get',
    params: parameter
  })
}

export function getAllPrice(parameter) {
  return request({
    url: api.getAllPrice,
    method: 'get',
    params: parameter
  })
}

export function getBudgetInfoByMainId(parameter) {
  return request({
    url: api.getBudgetInfoByMainId + '/' + parameter,
    method: 'get'
    // params: parameter
  })
}

export function getCategory(parameter) {
  return request({
    url: api.getCategory,
    method: 'get',
    params: parameter
  })
}

export function addDevice(data) {
  return request({
    url: api.addDevice,
    method: 'post',
    data: data
  })
}

export function addLu(data) {
  return request({
    url: api.addLu,
    method: 'post',
    data: data
  })
}

export function addOther(data) {
  return request({
    url: api.addOther,
    method: 'post',
    data: data
  })
}

export function addPub(data) {
  return request({
    url: api.addPub,
    method: 'post',
    data: data
  })
}

export function addCon(data) {
  return request({
    url: api.addCon,
    method: 'post',
    data: data
  })
}

export function modifyProject(data) {
  return request({
    url: api.modify,
    method: 'post',
    data: data
  })
}

export function addSoftDevice(data) {
  return request({
    url: api.addSoftDevice,
    method: 'post',
    data: data
  })
}

export function addmetral(data) {
  return request({
    url: api.addmetral,
    method: 'post',
    data: data
  })
}

export function addAssay(data) {
  return request({
    url: api.addAssay,
    method: 'post',
    data: data
  })
}

export function addEx(data) {
  return request({
    url: api.addEx,
    method: 'post',
    data: data
  })
}

export function addFuel(data) {
  return request({
    url: api.addFuel,
    method: 'post',
    data: data
  })
}

export function addTrial(data) {
  return request({
    url: api.addTrial,
    method: 'post',
    data: data
  })
}

export function addOut(data) {
  return request({
    url: api.addOut,
    method: 'post',
    data: data
  })
}

export function saveBuget(data) {
  return request({
    url: api.saveBuget,
    method: 'post',
    data: data
  })
}

export function deleteSoftDevice(parameter) {
  return request({
    url: api.deleteSoftDevice,
    method: 'delete',
    params: parameter
  })
}

export function deleteLu(parameter) {
  return request({
    url: api.deleteLu,
    method: 'delete',
    params: parameter
  })
}

export function deleteOther(parameter) {
  return request({
    url: api.deleteOther,
    method: 'delete',
    params: parameter
  })
}

export function deleteAssay(parameter) {
  return request({
    url: api.deleteAssay,
    method: 'delete',
    params: parameter
  })
}

export function deletePub(parameter) {
  return request({
    url: api.deletePub,
    method: 'delete',
    params: parameter
  })
}

export function deleteCon(parameter) {
  return request({
    url: api.deleteCon,
    method: 'delete',
    params: parameter
  })
}

export function deleteFuel(parameter) {
  return request({
    url: api.deleteFuel,
    method: 'delete',
    params: parameter
  })
}

export function deleteEx(parameter) {
  return request({
    url: api.deleteEx,
    method: 'delete',
    params: parameter
  })
}

export function deleteMember(parameter) {
  return request({
    url: api.deleteMember,
    method: 'delete',
    params: parameter
  })
}

export function deleteOut(parameter) {
  return request({
    url: api.deleteOut,
    method: 'delete',
    params: parameter
  })
}

export function deleteTrial(parameter) {
  return request({
    url: api.deleteTrial,
    method: 'delete',
    params: parameter
  })
}

export function deleteMetral(parameter) {
  return request({
    url: api.deleteMetral,
    method: 'delete',
    params: parameter
  })
}

export function deleteDevice(parameter) {
  return request({
    url: api.deleteDevice,
    method: 'delete',
    params: parameter
  })
}

export function getBigCategory(parameter) {
  return request({
    url: api.getBigCategory,
    method: 'get',
    params: parameter
  })
}

export function assayList(parameter) {
  return request({
    url: api.assayList,
    method: 'get',
    params: parameter
  })
}

export function getPrice(parameter) {
  return request({
    url: api.getPrice,
    method: 'get',
    params: parameter
  })
}

export function luList(parameter) {
  return request({
    url: api.luList,
    method: 'get',
    params: parameter
  })
}

export function exList(parameter) {
  return request({
    url: api.exList,
    method: 'get',
    params: parameter
  })
}

export function otherList(parameter) {
  return request({
    url: api.otherList,
    method: 'get',
    params: parameter
  })
}

export function conList(parameter) {
  return request({
    url: api.conList,
    method: 'get',
    params: parameter
  })
}

export function pubList(parameter) {
  return request({
    url: api.pubList,
    method: 'get',
    params: parameter
  })
}

export function trialList(parameter) {
  return request({
    url: api.trialList,
    method: 'get',
    params: parameter
  })
}

export function outList(parameter) {
  return request({
    url: api.outList,
    method: 'get',
    params: parameter
  })
}

export function getCategoryTable(parameter) {
  return request({
    url: api.getCategoryTable,
    method: 'get',
    params: parameter
  })
}

export function metralList(parameter) {
  return request({
    url: api.metralList,
    method: 'get',
    params: parameter
  })
}

export function fuelList(parameter) {
  return request({
    url: api.fuelList,
    method: 'get',
    params: parameter
  })
}

export function getDeviceTable(parameter) {
  return request({
    url: api.getDeviceTable,
    method: 'get',
    params: parameter
  })
}

export function softDeviceTable(parameter) {
  return request({
    url: api.softDeviceTable,
    method: 'get',
    params: parameter
  })
}

export function getSmallCategory(parameter) {
  return request({
    url: api.getSmallCategory,
    method: 'get',
    params: parameter
  })
}

export function getPage(parameter) {
  return request({
    url: api.page,
    method: 'get',
    params: parameter
  })
}

export function update(data) {
  return request({
    url: api.update,
    method: 'post',
    data: data
  })
}

export function upload(data) {
  return request({
    url: api.upload,
    method: 'post',
    data: data
  })
}

export function download(data) {
  return request({
    url: api.download + data.url,
    method: 'get'
  })
}

export function deleteById(parameter) {
  return request({
    url: api.delete,
    method: 'delete',
    params: parameter
  })
}

export function getDept(parameter) {
  return request({
    url: dept.dept,
    method: 'get',
    params: parameter
  })
}

export function downloadDocData(parameter) {
  return request({
    url: api.downloadDocData,
    method: 'get',
    params: parameter
  })
}

export function downloadAllDocData(parameter) {
  return request({
    url: api.downloadAllDocData,
    method: 'get',
    params: parameter
  })
}

export function detail(parameter) {
  return request({
    url: api.detail,
    method: 'get',
    params: parameter
  })
}

export function addProject(data) {
  return request({
    url: api.add,
    method: 'post',
    data: data
  })
}

export function getMember(parameter) {
  return request({
    url: api.getMember,
    method: 'get',
    params: parameter
  })
}

export function getDemon(parameter) {
  return request({
    url: api.getDemon,
    method: 'get',
    params: parameter
  })
}

export function getFileInfo(parameter) {
  return request({
    url: api.getFileInfo,
    method: 'get',
    params: parameter
  })
}

export function getSummaryAmount(parameter) {
  return request({
    url: api.getSummaryAmount,
    method: 'get',
    params: parameter
  })
}

export function getSummaryYearAmount(parameter) {
  return request({
    url: api.getSummaryYearAmount,
    method: 'get',
    params: parameter
  })
}

export function addMember(data) {
  return request({
    url: api.addMember,
    method: 'post',
    data: data
  })
}

export function saveDocData(data) {
  return request({
    url: api.saveDocData,
    method: 'post',
    data: data
  })
}

export function updateMember(data) {
  return request({
    url: api.updateMember,
    method: 'post',
    data: data
  })
}

export function updateDemon(data) {
  return request({
    url: api.updateDemon,
    method: 'post',
    data: data
  })
}

export function getDataByUrl(url) {
  return request({
    url: url,
    method: 'get'
  })
}
